<?php
class ss_cli_command_auto extends ss_cli_command {
	
	public function __construct($config,$ss){
		parent::__construct($config,$ss);
	}
	
	public function execute(){
		return call_user_func_array(array($this,'update'),func_get_args());
	}
	
	public function update(){
		$_command=array(
			array('doctrine',array('dump')),
			array('mangle',array('mangle')),
			array('doctrine',array('dropDb')),
			array('doctrine',array('createDb')),
			array('merge',array('schema')),
			array('interface',array('generate')),
			array('doctrine',array('yamlToModel')),
			array('doctrine',array('modelToTable')),
			array('doctrine',array('load')),
		);
		foreach($_command as $_com){
			
			$this->dispatch->output("\n*** Calling {$_com[0]} {$_com[1][0]} ***");
			//$_obj=$this->dispatch->getCommand($_com[0]);
			if(call_user_func_array(array($this->dispatch,$_com[0]),$_com[1])===false) return false;
		}
		return true;
	}
}
?>